package com.bank.bank.transaction.mapper;


import com.bank.bank.common.base.pojo.dto.DrawMoneyParam;
import com.bank.bank.common.base.pojo.dto.SaveMoneyParam;
import com.bank.bank.common.base.pojo.entity.Transaction;
import com.bank.bank.common.base.pojo.vo.DrawMoneyVO;
import com.bank.bank.common.base.pojo.vo.SaveMoneyVO;
import com.bank.bank.common.base.pojo.vo.TransactionDetailVO;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface TransactionMapper {
    int saveMoneyInsertTransaction(Transaction transaction);

    int saveMoneyUpdateTransactionByToAccountId(SaveMoneyParam saveMoneyParam);

    SaveMoneyVO saveMoneySelectTransactionInfo(Transaction transaction);

    Double selectBalanceByFromAccountId(Integer fromAccountId);

    int drawMoneyUpdateTransactionByFromAccountId(DrawMoneyParam drawMoneyParam);

    DrawMoneyVO drawMoneySelectTransactionInfo(Transaction transaction);

    TransactionDetailVO selectTransactionInfoById(String transactionId);

    List<Transaction> selectTransactionByAccountIdOrderedByCreatedAtDesc(Integer accountId);
}
